<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
	<script language="JavaScript"
			src="${pageContext.request.contextPath}/js/public.js"></script>
			<link rel="stylesheet" type="text/css"
			href="${pageContext.request.contextPath}/css/public.css">
		
		<title>权限管理</title>
				<script type="text/javascript">		
		function purviewManage(){		
			var functionTypeIDs = document.getElementsByName("functionTypeChecked");
			var editID="";
			var formname = document.getElementById("purviewManageForm");//formd的ID
	
			for (var i = 0; i < functionTypeIDs.length; i++) {	
				if (functionTypeIDs[i].checked) {					
					editID = editID+functionTypeIDs[i].value+",";
				}
			}
	 		
					if (confirm("确认管理该用户组吗？")) {
						formname.action = "editUserPurview.action?editFunctionTypeID="+editID+"&editUserGroupID="+${request.editedUserRole.roleId};	
						formname.submit();
					}
		}
		</script>
		<style type="text/css">
/*全选按钮*/
#selectAll {
	font-size: 10pt;
	color: #403040;
	font-weight: bold;
	height: 30px;
	padding: 6px;
	margin-bottom: -6px;
}

/*大表格样式*/
.fTable {
	background: #FBFBFB;
	width: 100%;
}

/*列表第一列样式，即左边模块名称*/
#colStyle {
	font-size: 11pt;
	color: #403040;
	font-weight: 550;
	width: 80px;
	padding-top: 6px;
}

/*功能选择区域*/
.functionSelect {
	font-size: 10pt;
	font-weight: bold;
	color: #403040;
	margin-top: -6px;
}

/*功能选择区域表格样式*/
.functionSelect table {
	width: 100%;
	background: #FBFBFB;
}

/*功能选择区域td样式*/
.functionSelect td {
	width: 180px;
	font-size: 9pt;
	color: #403040;
}
</style>
	</head>

	<body>
	<s:form action="purviewManageForm" theme="simple" id="purviewManageForm" >
	<div id="info_all">
			<div id="info_top">
				请对用户组:&nbsp;&nbsp;
				<span style="color: #6699c9;"><s:property value="#request.editedUserRole.roleName" /></span>&nbsp;&nbsp;进行权限管理
			</div>
			<!-- 选择所有权限 -->
			<div id="selectAll">
				<input type="checkbox" onclick="selectAll()" />
				全选
				
			</div>
			<div>
				<table cellspacing=10px cellpadding=1px class="fTable" id="info_table">
					<col id="colStyle" valign="top"></col>
					<col></col>
					<s:iterator value="#request.functionTypeMap">
					<tr>
						<td>
							<s:property value="key.functionType" />：
						</td>
						<td>
							<div class="functionSelect">
								<hr>
								
								
								<s:iterator value="#request.functionTypeMap[key]" status="status">
							
										
											<input type="checkbox" name="functionTypeChecked"
									value="<s:property value="functionTypeId"/>"
									<s:iterator value="#request.functionIDOfRoleIDs" status="functionIDStatus">
             							<s:if test="%{functionTypeId==#request.functionIDOfRoleIDs[#functionIDStatus.index]}">
            								checked
            							</s:if>
									</s:iterator>
									>
											<s:property value="functionType" />
											
										
								<s:if test="%{(#status.index+1)%4==0}">
											<br>
											
										</s:if>
									
							</s:iterator>
									
									
								
							</div>
						</td>
					</tr>
					</s:iterator>
					<tr>
					<td colspan="2" align="center">
						&nbsp;&nbsp;
						<input type="button" value="保存" onFocus="this.blur()" 
							onClick="purviewManage()" onmouseover="this.className='btnover'"
							onmouseout="this.className='btnout'" class="btnsize" />
						&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						&nbsp;
						<input type="button" value="返回" onFocus="this.blur()"
							onclick="history.go(-1)" onmouseover="this.className='btnover'"
							onmouseout="this.className='btnout'" class="btnsize" />

					</td>
				</tr>
				</table>
			</div>
		</div>
		</s:form>
	</body>
</html>
